import React from 'react'
import { Route, IndexRoute } from 'react-router'
export default {
    path: '/',
    getComponent : function(location, callback){
        require.ensure([], function (require) {//参数1：依赖 参数2：回调   参数3：chunkName
            callback(null, require('../components/App').default)
        })
    },
    getIndexRoute(location, callback) {
        console.log('按需加载Home首页...')
        require.ensure([], function (require) {
            callback(null, {
                component: require('../components/Home').default
            })
        })
    },
    getChildRoutes(location, callback) {
        console.log('按需加载子路由...')
        require.ensure([], function (require) {
            callback(null, [
                require('./childRoute1').default,
                require('./childRoute2').default,
                require('./count').default,
            ])
        })
    }
}